package com.example.jay.day45.task;

import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;

import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;

/**
 *
 */
public class ClientThread extends Thread {
    private BluetoothDevice device;
    private UUID uuid = UUID.fromString("00001106-0000-1000-8000-00805F9B34FB");

    public ClientThread(BluetoothDevice device) {
        this.device = device;
    }

    @Override
    public void run() {
        super.run();
        try {
            BluetoothSocket socket = device.createInsecureRfcommSocketToServiceRecord(uuid);
            if (!socket.isConnected()) {
                socket.connect();
            }
            InputStream inputStream = socket.getInputStream();


        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
